package test.design_pattern.castle_game.step3.handler;

import test.design_pattern.castle_game.step3.Game;

/**
 * @author zhangrui
 * @date 2020-04-13 15:00
 * @since 1.0
 */

public class GoHandler extends CmdHandler {

    private Game game ;

    public GoHandler(Game game){
        this.game = game ;
    }

    @Override
    public void doCmd(String word) {
        super.doCmd(word);
        if(game != null){
            game.goRoom(word);
        }
        else{
            System.out.println("game不存在");
        }
    }
}
